@use '@/styles/vars.scss' as vars;

// 抽屉内容样式
.theme-drawer-content {
  padding: 10px 0;
}

// 内置主题单选按钮组
.theme-radio-group {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid vars.$border-color;

  .ant-radio-button-wrapper {
    flex: 1;
    min-width: 80px;
    text-align: center;
    padding: 8px 12px;
    border: none;
    border-radius: 0;
    background-color: transparent;
    transition: all 0.3s vars.$transition-bezier;
    font-weight: 500;
    color: vars.$text-secondary;
    display: flex;
    align-items: center;
    justify-content: center;

    &:hover {
      color: vars.$primary-color;
      background-color: vars.$primary-light;
      border-color: transparent;
    }

    &:first-child {
      border-radius: 6px 0 0 6px;
    }

    &:last-child {
      border-radius: 0 6px 6px 0;
    }

    &.ant-radio-button-wrapper-checked {
      color: #fff;
      background-color: vars.$primary-color;
      border-color: vars.$primary-color;
      box-shadow: none;

      &:hover {
        color: #fff;
        background-color: vars.$primary-hover;
        border-color: vars.$primary-hover;
      }
    }

    &:not(:last-child) {
      border-right: 1px solid vars.$border-color;
    }
  }
}

// 颜色方案选择器
.color-schemes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
  gap: 12px;
  margin: 15px 0;
}

.color-scheme-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  transition: all 0.3s vars.$transition-bezier;

  &:hover {
    background-color: vars.$bg-light;
  }

  &.active {
    background-color: vars.$primary-light;
  }
}

.color-scheme-preview {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  margin-bottom: 6px;
  border: 2px solid transparent;
  transition: all 0.3s vars.$transition-bezier;

  .color-scheme-item.active & {
      border-color: vars.$primary-color;
      box-shadow: 0 0 0 2px rgba(var(--primary-color-rgb), 0.15), 0 2px 8px rgba(var(--primary-color-rgb), 0.2);
      transform: scale(1.05);
    }
}

// 自定义颜色选择器
.custom-color-section {
  margin-top: 15px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.custom-color-picker {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

// 响应式调整
@media (max-width: 768px) {
  .color-schemes {
    grid-template-columns: repeat(3, 1fr);
  }

  .theme-radio-group {
    flex-direction: column;

    .ant-radio-button-wrapper {
      min-width: auto;
    }
  }
}